package com.swust.test;

import com.swust.dao.UserInfoDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class UserRunner implements ApplicationRunner {
    @Autowired
    UserInfoDao userInfoDao;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        userInfoDao.findById(1L).subscribe(x -> System.out.println(x.getName()));

        userInfoDao.findDateByIdAndName(2L, "chenyixing").subscribe(x -> System.out.println(x.getName()));
    }
}
